declare @UserId int
set @UserId = 12

insert into dbo.ReadMessages
select m.TopicId, m.MessageId, @UserId as UserId
from 
	dbo.Messages m 
	left join dbo.ReadMessages rm
	  on m.TopicId = rm.TopicId and m.MessageId = rm.MessageId and rm.UserId=@UserId
where
	m.MessageCreationDate < '30.08.2012' 
	and rm.MessageId is null